<template>
    <el-container>
        <div class='shop-frame'>
            <el-card>
                <el-form :label-position="top" :rules="rules" label-wideth="80px" size="medium">
                    <el-form-item>
                        <p>1、你最近是否有失眠? </p>
                        <el-radio-group v-model="radio">
                            <el-radio label="1">基本没有</el-radio>
                            <el-radio label="2">不知道</el-radio>
                            <el-radio label="3">偶尔</el-radio>
                            <el-radio label="4">总是</el-radio>
                        </el-radio-group>
                        <p>2、你会为你身边的朋友打几分? </p>
                        <el-radio-group v-model="radio1">
                            <el-radio label="1">满分</el-radio>
                            <el-radio label="2">优秀</el-radio>
                            <el-radio label="3">说不清楚</el-radio>
                            <el-radio label="4">及格</el-radio>
                        </el-radio-group>

                        <p>3、你认为最近生活与工作很难协调么? </p>
                        <el-radio-group v-model="radio2">
                            <el-radio label="1">是的</el-radio>
                            <el-radio label="2">有一点</el-radio>
                            <el-radio label="3">说不清楚</el-radio>
                            <el-radio label="4">没有</el-radio>
                        </el-radio-group>

                        <p>4、如果你病了,你需要吃药,医生告诉你吃一片,你会吃多少? </p>
                        <el-radio-group v-model="radio3">
                            <el-radio label="1">半片</el-radio>
                            <el-radio label="2">一片</el-radio>
                            <el-radio label="3">两片</el-radio>
                            <el-radio label="4">不吃</el-radio>
                        </el-radio-group>

                        <p>5、你觉得你十分容易与陌生人搭讪么? </p>
                        <el-radio-group v-model="radio4">
                            <el-radio label="1">是的</el-radio>
                            <el-radio label="2">还算可以</el-radio>
                            <el-radio label="3">有点难</el-radio>
                            <el-radio label="4">十分难</el-radio>
                        </el-radio-group>

                        <p>6、满分如果是9分你会给现在的你打几分? </p>
                        <el-radio-group v-model="radio5">
                            <el-radio label="1">8分</el-radio>
                            <el-radio label="2">6分</el-radio>
                            <el-radio label="3">4分</el-radio>
                            <el-radio label="4">不知道</el-radio>
                        </el-radio-group>

                        <p>7、你觉得患有心理疾病的病人值得同情么? </p>
                        <el-radio-group v-model="radio6">
                            <el-radio label="1">偶有</el-radio>
                            <el-radio label="2">有时</el-radio>
                            <el-radio label="3">经常</el-radio>
                            <el-radio label="4">持续</el-radio>
                        </el-radio-group>

                        <p>8.你在填这份问卷时抱着什么态度?</p>
                        <el-radio-group v-model="radio7">
                            <el-radio label="1">好奇</el-radio>
                            <el-radio label="2">获得知识</el-radio>
                            <el-radio label="3">说不清楚</el-radio>
                            <el-radio label="4">纯属娱乐</el-radio>
                        </el-radio-group>

                        <p>9、在下午时分,你走在大街上你背后有个影子,你会认为是什么? </p>
                        <el-radio-group v-model="radio8">
                            <el-radio label="1">我自己的影子</el-radio>
                            <el-radio label="2">别人的影子</el-radio>
                            <el-radio label="3">不清楚</el-radio>
                            <el-radio label="4">那是影子吗</el-radio>
                        </el-radio-group>

                        <p>10、一棵树上,你看见一只猫跑过去,你会想到什么? </p>
                        <el-radio-group v-model="radio9">
                            <el-radio label="1">他在追老鼠</el-radio>
                            <el-radio label="2">他在练跑步</el-radio>
                            <el-radio label="3">他喜欢树上的小鸟</el-radio>
                            <el-radio label="4">有人在后面准追她</el-radio>
                        </el-radio-group>

                        <p>11、你认为你最近的焦虑指数怎么样? </p>
                        <el-radio-group v-model="radio10">
                            <el-radio label="1">没听说这个东西，所以不知道</el-radio>
                            <el-radio label="2">还算正常</el-radio>
                            <el-radio label="3">有点高</el-radio>
                            <el-radio label="4">十分高</el-radio>
                        </el-radio-group>

                        <p>12、你觉得秋天的雨天怎么样? </p>
                        <el-radio-group v-model="radio11">
                            <el-radio label="1">季节正常规律，很惬意</el-radio>
                            <el-radio label="2">有点冷</el-radio>
                            <el-radio label="3">跟我的心情一样，有点抑郁</el-radio>
                            <el-radio label="4">太难受了</el-radio>
                        </el-radio-group>

                        <p>13、你认为那些有名作家是有些神经质么? </p>
                        <el-radio-group v-model="radio12">
                            <el-radio label="1">完全就是</el-radio>
                            <el-radio label="2">应该有点吧</el-radio>
                            <el-radio label="3">不知道</el-radio>
                            <el-radio label="4">不觉得</el-radio>
                        </el-radio-group>

                        <p>14、你觉得跟陌生人说话你会呼吸急促么? </p>
                        <el-radio-group v-model="radio13">
                            <el-radio label="1">完全是的</el-radio>
                            <el-radio label="2">应该有点吧</el-radio>
                            <el-radio label="3">不知道</el-radio>
                            <el-radio label="4">不觉得</el-radio>
                        </el-radio-group>

                        <p>15、你独自一个人静静待在一间屋子里最长的时间是多久? </p>
                        <el-radio-group v-model="radio14">
                            <el-radio label="1">1至2个小时</el-radio>
                            <el-radio label="2">6个小时</el-radio>
                            <el-radio label="3">半天</el-radio>
                            <el-radio label="4">一天</el-radio>
                        </el-radio-group>
                        <p style="font-weight: bold;">尊敬的来访者：
                            感谢您的信任。在正式开始咨询之前，有些相关事宜需要告知于您，以便咨询更好地开展，请您阅读后点击同意按钮，以表明您已经仔细阅读过并同意这些条款。</p>
                        <div class="studentList-btn">
                            <el-button class="formBtn" @click="messageDialogVisible = true">
                                同意
                            </el-button>
                            <el-button class="formBtn" @click="handleComplaint()" >
                                提交
                            </el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </el-card>
            <el-dialog v-model="messageDialogVisible" title="同意需知" @close="messageDialogVisible = false"
                       width="650px"
                       :close-on-click-modal="false" center>
                <div class='shop-frame'>
                    <p>尊敬的来访者：</p>

                    <p>感谢您的信任。在正式开始咨询之前，有些相关事宜需要告知于您，以便咨询更好地开展，咨询更好地开展，请您阅读后在勾选已阅读按钮，以表明您已经仔细阅读过并同意这些条款。
                    </p>
                    <p> 1、收费设置：</p>
                    <p> 咨询师的收费标准是 200元/50分钟。费用按月结算，月末支付。如果您想预约时间，请至少提前24小时打电话或邮件告知，电话号码：123456789
                        邮箱：12345@happyevery.com。如果您已经约定时间，需要临时取消，请提前一天通知；如果您在约好的时间未通知我们取消而不来应诊，您有责任支付您所约定当次的咨询费用。连续两次未能提前24小时通知而不来应诊，将视为您取消之后所有预约的咨询。
                    </p>
                    <p> 2、保密性：</p>
                    <p>在一般情况下，咨询师对您所提供的信息保密，包括个案记录、测验资料、信件、录音、录像和其他资料，均属专业信息，在严格保密的情况下进行保存，避免在任何公众场合公开；
                    </p>
                    <p>3、来访者的责任：</p>

                    <p>来访者在咨询工作中需要做到：1）参加并参与咨询面谈；2）按照协议付费；3）在咨询中尽可能表达和分享自己的想法和感受；4）认真思考自己的表达、咨询师的回应以及二人的互动交流过程。
                    </p>
                    <p>4、咨询师的责任：</p>

                    <p>
                        咨询师在咨询工作中需要做到：1）为来访者安排双方合适的咨询日程；2）努力帮助来访者通向对自我、现状的理解、帮助来访者更好地处理当下面临的种种困苦以及生活事件；3）定期参加专业学习和案例讨论会，确保自己胜任与来访者的咨询工作；4）清楚自己的身为咨询师的有限性，在咨询无效、失败的时候及时与来访者讨论结束咨询、转介等事宜。
                    </p>
                    <el-button class="formBtn" @click="messageDialogVisible = false">
                        确定
                    </el-button>
                </div>
            </el-dialog>
        </div>
    </el-container>
</template>
<script>
    import request from "../../utils/request"
    import {ElMessage} from "element-plus";

    export default {
        data() {
            return {
                messageDialogVisible: false,

                radio: undefined,
                radio1: undefined,
                radio2: undefined,
                radio3: undefined,
                radio4: undefined,
                radio5: undefined,
                radio6: undefined,
                radio7: undefined,
                radio8: undefined,
                radio9: undefined,
                radio10: undefined,
                radio11: undefined,
                radio12: undefined,
                radio13: undefined,
                radio14: undefined,
                userForm: {},
                rules: {
                    radio: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio1: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio2: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio3: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio4: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio5: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio6: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio7: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio8: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio9: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio10: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio11: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio12: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio13: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                    radio14: [{
                        required: true,
                        message: '答案不能为空',
                        trigger: 'change'
                    }],
                }
            }
        },
        methods: {

            addRegister(issueScore,username) {
                return request({
                        url: '/api/visitLog/savestatus/'+username+'/'+issueScore,
                        method: 'get',
                    }

                )
            },
            handleComplaint() {
                var issueScore = Number(this.radio) + Number(this.radio1) + Number(this.radio2) + Number(this.radio3) + Number(this.radio4) + Number(this.radio5) + Number(this.radio6) + Number(this.radio7) + Number(this.radio8) + Number(this.radio9) + Number(this.radio10) + Number(this.radio11) + Number(this.radio12) + Number(this.radio13) + Number(this.radio14);
                this.userForm.issueScore = issueScore
                this.addRegister(issueScore,localStorage.getItem('ms_username')).then(res => {
                    alert(res.message)
                })
                console.log(this.userForm)
            }
        }
    }

</script>
<style>
    .shop-frame {
        text-align: center;
    }
</style>
